﻿using System;

namespace RexToy.UI.Controls
{
    public class ToolBarButton : IconButton
    {
        private HeaderBarPosition __position;
        public HeaderBarPosition Position
        {
            get { return __position; }
            set
            {
                var template = "ui-btn-{0}";
                this.__domNode.ReplaceClass(StringExt.Format(template, this.__position), StringExt.Format(template, value));
                this.__position = value;
            }
        }

        public ToolBarButton(string text, IconPosition position)
            : base(text, position)
        {
            var pos = StringExt.Format("ui-btn-{0}", this.__position);
            this.__domNode.AppendClass(pos);

            var style = this.__domNode.GetStyle();
            style.MarginRight = "2px";
            style.MarginLeft = "2px";
        }
    }
}
